<template>
  <div>
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
        <el-col :span="12">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="单行文本" prop="field106">
                <el-input
                  v-model="formData.field106"
                  placeholder="请输入单行文本"
                  clearable
                  :style="{width: '100%'}"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="12">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="单行文本" prop="field108">
                <el-input
                  v-model="formData.field108"
                  placeholder="请输入单行文本"
                  clearable
                  :style="{width: '100%'}"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="12">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="密码" prop="field109">
                <el-input
                  v-model="formData.field109"
                  placeholder="请输入密码"
                  clearable
                  show-password
                  :style="{width: '100%'}"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="12">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="下拉选择" prop="field110">
                <el-select
                  v-model="formData.field110"
                  placeholder="请选择下拉选择"
                  clearable
                  :style="{width: '100%'}"
                >
                  <el-option
                    v-for="(item, index) in field110Options"
                    :key="index"
                    :label="item.label"
                    :value="item.value"
                    :disabled="item.disabled"
                  />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="24">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="多行文本" prop="field112">
                <el-input
                  v-model="formData.field112"
                  type="textarea"
                  placeholder="请输入多行文本"
                  :autosize="{minRows: 4, maxRows: 4}"
                  :style="{width: '100%'}"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="12">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="时间选择" prop="field115">
                <el-time-picker
                  v-model="formData.field115"
                  format="HH:mm:ss"
                  value-format="HH:mm:ss"
                  :picker-options="{&quot;selectableRange&quot;:&quot;00:00:00-23:59:59&quot;}"
                  :style="{width: '100%'}"
                  placeholder="请选择时间选择"
                  clearable
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="12">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="滑块" prop="field117" required>
                <el-slider v-model="formData.field117" :max="100" :step="1" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="12">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="滑块" prop="field119" required>
                <el-slider v-model="formData.field119" :max="100" :step="1" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="12">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="开关" prop="field121" required>
                <el-switch v-model="formData.field121" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="24">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="评分" prop="field123">
                <el-rate v-model="formData.field123" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="24">
          <el-row gutter="15">
            <el-col :span="24">
              <el-form-item label="颜色选择" prop="field125" required>
                <el-color-picker v-model="formData.field125" size="medium" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="24">
          <el-form-item size="large">
            <el-button type="primary" @click="submitForm">提交</el-button>
            <el-button @click="resetForm">重置</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        field106: undefined,
        field108: 'entfrm',
        field109: '123456',
        field110: undefined,
        field112: undefined,
        field115: null,
        field117: 0,
        field119: 0,
        field121: false,
        field123: 0,
        field125: null
      },
      rules: {
        field106: [{
          required: true,
          message: '请输入单行文本',
          trigger: 'blur'
        }],
        field108: [{
          required: true,
          message: '请输入单行文本',
          trigger: 'blur'
        }],
        field109: [{
          required: true,
          message: '请输入密码',
          trigger: 'blur'
        }],
        field110: [{
          required: true,
          message: '请选择下拉选择',
          trigger: 'change'
        }],
        field112: [{
          required: true,
          message: '请输入多行文本',
          trigger: 'blur'
        }],
        field115: [{
          required: true,
          message: '请选择时间选择',
          trigger: 'change'
        }],
        field123: [{
          required: true,
          message: '评分不能为空',
          trigger: 'change'
        }]
      },
      field110Options: [{
        'label': '选项一',
        'value': 1
      }, {
        'label': '选项二',
        'value': 2
      }]
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    }
  }
}

</script>
<style>
.el-rate {
  display: inline-block;
  vertical-align: text-top;
}

</style>
